/*    */ package com.zimbra.cs.mailclient.util;
/*    */ 
/*    */ import java.util.Calendar;
/*    */ import java.util.Date;
/*    */ import java.util.GregorianCalendar;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class DateUtil
/*    */ {
/* 24 */   private static final String[] MONTH_NAME = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
/*    */   
/*    */ 
/*    */ 
/*    */   public static String toImapDateTime(Date date)
/*    */   {
/* 30 */     Calendar cal = new GregorianCalendar();
/* 31 */     cal.setTime(date);
/*    */     
/* 33 */     int tzoffset = (cal.get(15) + cal.get(16)) / 60000;
/* 34 */     char tzsign = tzoffset > 0 ? '+' : '-';
/* 35 */     tzoffset = Math.abs(tzoffset);
/*    */     
/* 37 */     return String.format("%02d-%s-%d %02d:%02d:%02d %c%02d%02d", new Object[] { Integer.valueOf(cal.get(5)), MONTH_NAME[cal.get(2)], Integer.valueOf(cal.get(1)), Integer.valueOf(cal.get(11)), Integer.valueOf(cal.get(12)), Integer.valueOf(cal.get(13)), Character.valueOf(tzsign), Integer.valueOf(tzoffset / 60), Integer.valueOf(tzoffset % 60) });
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mailclient/util/DateUtil.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */